﻿


-- =============================================
-- Author:		<Author,XFL>
-- Edit date: <Create Date,2012 02 01>
-- Description:	<Description, 
-- [人资管理]-[员工工资管理]-[工资表查询及修改]
-- 增加固定补助 其他补助  FixedAllowance、QtAllowance
-- 2015.03.26 增加 报销金额，免税金额两个字段
-- =============================================
create PROCEDURE [dbo].[proc_Wage_Update_20150326]
	(
		@Id int,
		@FAllowance decimal(18,2),
		@QtAllowance decimal(18,2),
		@TiCheng decimal(18,2),
		@MTiCheng decimal(18,2),
		@Jxyuan decimal(18,2),
		@Jxkou decimal(18,2),
		@JxWage decimal(18,2),
		@YjBonus decimal(18,2),
		@LsBonus decimal(18,2),
		@BxKouKuan decimal(18,2),
		@YJKouKuan decimal(18,2),
		@OtherKouKuan decimal(18,2),
		@HeJi  decimal(18,2),
		@DFHeJi  decimal(18,2),
		@YFHeJiT  decimal(18,2),
		@GRSDSKouKuan  decimal(18,2),
		@GJJKouKuan  decimal(18,2),
		@ZBwance  decimal(18,2),
		@LSwance  decimal(18,2),
		@BLTC  decimal(18,2),
		@XFTC  decimal(18,2),
		@XSTC  decimal(18,2),
		@bxje  decimal(18,2),
		@msje  decimal(18,2)
	)
AS
	Update Employee_Wage Set
	--FixedAllowance=@FAllowance,
	QtAllowance=@QtAllowance,
	TiCheng=@TiCheng,
	MTiCheng=@MTiCheng,
	Jxyuan=@Jxyuan,
	Jxkou=@Jxkou,
	JxWage=@JxWage,
	YjBonus=@YjBonus,
	LsBonus=@LsBonus,
	BxKouKuan=@BxKouKuan,
	YJKoukuan=@YJKouKuan,
	OtherKouKuan=@OtherKouKuan,
--新增 工资合计 @ XFL 2012 02 15
--HeJiWage=BasicWage+ PostWage+ WorkWage+ JxWage+ ManQin+ Allowance+ FAllowance+ QtAllowance+ TiCheng+ MTiCheng+ YjBonus+ LsBonus - ChuQinKouKuan- ChiDaoKouKuan-BxKouKuan-YJKouKuan-OtherKouKuan
--HeJiWage=(
--		([BasicWage])
--		+([PostWage])
--		+([WorkWage])
--		+(@JxWage)
--		+([ManQin])
--		+([Allowance])
--		+([FixedAllowance])
--		+(@QtAllowance)
--		+(@TiCheng)
--		+(@MTiCheng)
--		+(@YjBonus)
--		+(@LsBonus)
--		-([ChuQinKouKuan])
--		-(@BxKouKuan)
--		-([ChiDaoKouKuan])
--		-(@YJKouKuan)
--		-(@OtherKouKuan)
--),

 HeJiWage =   @HeJi    ,          
DFHeJi  =		 @DFHeJi  ,
YFHeJi  =		 @HeJi+  @DFHeJi,
GRSDSKouKuan =	 @GRSDSKouKuan,
GJJKouKuan   =	 @GJJKouKuan  ,
ZBwance   =		 @ZBwance  ,
LSwance   =		 @LSwance  ,
BLTC   =		 @BLTC  ,
XFTC   =		 @XFTC  ,
XSTC   =		 @XSTC  ,

bxje   =		 @bxje  ,
msje   =		 @msje  ,

	HRFlag=2,
	HRFlagDate=GetDate()
	Where Id=@Id
	RETURN






